package com.ae.putingotdown.net;

import com.ae.putingotdown.ModConstant;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.simple.SimpleChannel;

public class ModNetWork {
    public static final String NETWORK_VER = "1";
    public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel(new ResourceLocation(ModConstant.MOD_ID, "channel_1"), () -> NETWORK_VER, version -> version.equals(NETWORK_VER), version -> version.equals(NETWORK_VER));

    public static void register() {
        CHANNEL.registerMessage(0, KeyDown.class, KeyDown::encode, KeyDown::decode, KeyDown::work);
    }
}
